import {fetch_get, fetch_post} from '../_utils/request'
import { baseUrl } from '../../config/index'

// 获取
export async function getUserList(data){
  return fetch_post({
    url:baseUrl+"user/list",
    method:"POST",
    data:{
      pageSize:10,
      pageNum:1
    }
  })
}

export async function getUserInfo(){
  return fetch_get({
    url:baseUrl+"user"
  })
}

// 修改用户信息
export async function updateUser(data){
  console.log(data);
  return fetch_post({
    url:baseUrl+"user",
    method:"PUT",
    data:{
      username:data.nickName,
      phone:data.phoneNumber,
      sex:data.gender,
      avatar:data.avatarUrl
    }
  })
}


